package com.tianbo.elfii.client.common;

import java.sql.ResultSet;
import java.sql.Statement;

class UpAndDownloadThread extends Thread {
	ElfiiCommonRunInfo runInfo;
	
    public UpAndDownloadThread() {
    }

    public void setRunInfo(ElfiiCommonRunInfo runInfo){
        this.runInfo=runInfo;
    }
    public void run() {

        Statement st ;
        ResultSet rs ;
        String str="";

        try {

            long startTimeMillis=System.currentTimeMillis();
            st = runInfo.getStatement1();

            //str="update trainningitemhhistoricalresultpo set IsUpload=1 where id in (0,'0098bdf1-09c2-4804-83ef-92bdfaa71b1f','f16e4e70-1557-482e-979f-48d6db179dc1')" ;
            //st.execute(str);
            long endTimeMillis=System.currentTimeMillis();
            //System.out.println(str+"\n SQL OK，Time:(1/1000) "+(endTimeMillis-startTimeMillis));

            if (ElfiiCommonConfigUtil.uploadMark==true) {
                System.out.println("--开始上传");
                //com.base.Hfsj.hf(); //-临时测试用                
                com.base.WriterWJ.createFile(); 
                com.base.WriterWJ.fileUp(); 
                System.out.println("--上传结束");
            }

            if (ElfiiCommonConfigUtil.downloadMark==true) {
                System.out.println("--开始下载");
                com.base.Download.downFile();
                com.base.Download.jyFile();
//                com.base.Download.moveFile();
//                com.base.Download.sqlFile();
                System.out.println("--下载结束");
            }

        } catch(Exception ee) {System.out.print(ee);}
    }
}
